package model.storage;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class SimpleShapeStorage<T> implements IShapeStorage<T> {

    private final List<T> list;

    public SimpleShapeStorage() {
        this.list = new ArrayList<T>();
    }

    public List<T> getAll() {
        return Collections.unmodifiableList(list);
    }

    public void remove(T entity) {
        list.remove(entity);
    }

    public void add(T entity) {
        list.add(entity);
    }

    @Override
    public void edit(T entity) {
        // empty...
    }

    @Override
    public void clear() {
        list.clear();
    }

}
